package taskman.ui;

import java.awt.EventQueue;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

import taskman.listener.OpenGanntViewActionListener;
import taskman.listener.OpenTasksTableActionListener;
import taskman.listener.OpenTreeViewActionListener;
import taskman.listener.OpenUsersTableActionListener;

public class MainWindow {

	private JFrame frmTaskManagementPanel;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainWindow window = new MainWindow();
					window.frmTaskManagementPanel.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainWindow() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmTaskManagementPanel = new JFrame();
		frmTaskManagementPanel.setTitle("Task Management Panel");
		frmTaskManagementPanel.setBounds(100, 100, 500, 400);
		frmTaskManagementPanel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmTaskManagementPanel.getContentPane().setLayout(new GridLayout(2, 0, 0, 0));
		
		JButton btnOpenUsersTable = new JButton("Open User Management Panel");
		btnOpenUsersTable.addActionListener(new OpenUsersTableActionListener());
		frmTaskManagementPanel.getContentPane().add(btnOpenUsersTable);
		
		JButton btnOpenTaskManagement = new JButton("Open Task Management Panel");
		btnOpenTaskManagement.addActionListener(new OpenTasksTableActionListener());
		frmTaskManagementPanel.getContentPane().add(btnOpenTaskManagement);

		JButton btnOpenTreeView = new JButton("Task Tree View Panel");
		btnOpenTreeView.addActionListener(new OpenTreeViewActionListener());
		frmTaskManagementPanel.getContentPane().add(btnOpenTreeView);
		
		JButton btnOpenGanntView = new JButton("Task Gannt View Panel");
		btnOpenGanntView.addActionListener(new OpenGanntViewActionListener());
		frmTaskManagementPanel.getContentPane().add(btnOpenGanntView);
	}

}
